import 'package:gold/generated/json/base/json_field.dart';
import 'dart:convert';

import 'package:gold/generated/json/coupon_model.g.dart';

@JsonSerializable()
class CouponModel {
	/// 用户优惠券ID
	@JSONField(name: 'user_coupon_id')
	int? userCouponId;
	/// 领取时间
	@JSONField(name: 'received_at')
	String? receivedAt;
	/// 到期时间
	@JSONField(name: 'expired_at')
	String? expiredAt;
	/// 优惠券名
	@JSONField(name: 'coupon_name')
	String? couponName;
	/// 满减条件，消费满多少
	@JSONField(name: 'min_amount')
	double? minAmount;
	/// 满减金额
	@JSONField(name: 'discount_amount')
	double? discountAmount;

	CouponModel();

	factory CouponModel.fromJson(Map<String, dynamic> json) => $CouponModelFromJson(json);

	Map<String, dynamic> toJson() => $CouponModelToJson(this);

	@override
	String toString() {
		return jsonEncode(this);
	}
}